package org.example.middownloadtool;

import org.example.middownloadtool.service.DownloadService;

import java.text.MessageFormat;

public class App {

    public static void main(String[] args) {

        String width="340";
        String height="240";
        String format="jpg";
        String url = MessageFormat.format("https://picsum.photos/{0}/{1}.{2}", width,height,format);
        String folderPath = MessageFormat.format("/tmp/2022/1/2/{0}-{1}", width,height);

        for(int i = 0; i<10;i++) {
            Thread thread = new DownloadService(url, folderPath,width,height,format);
            thread.start();
        }

        System.out.println(MessageFormat.format("check out: {0}",folderPath));


    }

}
